<?php  
	include_once "config.inc.php";
?>

<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<title>九宫格日记</title>
	<link rel="stylesheet" type="text/css" href="css/header.css"/>
	<script src="js/jquery-3.1.1.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/inidex.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
	<div id="htop">
		<img src="images/bg_top.jpg"/>
	</div>
		<div class="nav">
			<div id="logtext">
				》  <?php 
					if(isset($_SESSION['uname'])){
						echo $_SESSION['uname'];
					}
				 ?>欢迎光临九宫格日记网!
			</div>
			<ul id="menu">
				<li>
					<a href="index.php">首页</a>
				</li>
				<li>
					<?php 
						if($uid > 0){
							echo '<a href="index.php?uid='.$uid.'">我的日记</a>';
						}else{
							echo '<a href="javascript:reg();">注册</a>';
						}
					 ?>
				</li>
				<li>
					<?php 
						if($uid > 0){
							echo '<a href="write.php">写日记</a>';
						}else{
							echo '<a href="javascript:login()">登陆</a>';
						}
					 ?>
					
				</li>
				<li>
					<?php 
						if($uid > 0){
							//退出登陆,
							//session_destroy();//销毁sesson
							echo '<a href="logout.php">退出</a>';
						}else{
							echo '<a href="passworld.php">找回密码</a>';
						}
					 ?>
					
				</li>
			</ul>
		</div>
		<div id="reg" class="reg">
			<form name="freg" action="index.php" method="post" onsubmit="return regSubmit(this)">
				<ul style="padding-top: 20px;">
					用户注册
				</ul>
				<ul>
					<li>用户名:</li>
					<li><input type="text" name="uname" value="" /> *字母开头长度(2-20)</li>
				</ul>
				<ul>
					<li>密码:</li>
					<li><input type="password" name="upwd" /> * (6-20位)</li>
				</ul>
				<ul>
					<li>重复密码:</li>
					<li><input type="password" name="upwd1" /> * (与密码相同)</li>
				</ul>
				<ul>
					<li>Email:</li>
					<li><input type="text" name="email" /> * (格式必须正确)</li>
				</ul>
				<ul>
					<li>省份:
					</li>
					<li>
						<select id="sheng" name="sheng">
							<option value="">请选择</option>
						</select>
						城市:
						<select id="shi" name="shi">
							<option value="">请选择</option>
						</select></li>
				</ul>
				<ul>
					<li>密保问题</li>
					<li><input type="text" name="pwd2" /></li>
				</ul>
				<ul>
					<li>密保答案</li>
					<li><input type="text" name="pwd3" /></li>
				</ul>
				
				<input type="submit" name="subreg" value="注册"/>
				<input type="reset"  value="重置" />
				<input type="button" value="关闭" onclick="closeMe(this)" />
			</form>
		</div>
		<div id="login" class="reg" >
			<form name="flogin" action="login.php" method="post">
				<ul style="padding-top: 100px;">
					用户登陆
				</ul>
				<ul>
					<li>用户名:</li>
					<li><input type="text" name="uname" value="" /></li>
				</ul>
				<ul>
					<li>密码:</li>
					<li><input type="password" name="upwd" /></li>
				</ul>
				<ul>
					<li>验证码:</li>
					<li><input type="text" name="ucode" size="4" />
					<img  title="点击刷新" src="./gdcode.php" align="absbottom" onclick="this.src='gdcode.php?'+Math.random();"></img>
					</li>
				</ul>

				
				<input type="submit" name="sublogin" value="登陆"/>
				<input type="reset"  value="重置" />
				<input type="button" value="关闭" onclick="closeMe(this)" />
			</form>
		</div>
		
</body>
</html>